package cn.tedu.zuoye.common.exception;

import cn.tedu.zuoye.response.StatusCode;
import lombok.Getter;



@Getter
public class BusinessException extends RuntimeException {

    private int code;

    private String message;


    public BusinessException(StatusCode statusCode) {

        // 状态码
        this.code = statusCode.getCode();
        // 状态码配套的message
        this.message = statusCode.getMessage();
    }
    public BusinessException(String message) {

        this.code = StatusCode.PIC_NOTFOUND.getCode();
        this.message =StatusCode.PIC_NOTFOUND.getMessage();
    }

}
